home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvglue10.arc / TVINTBIT.C < prev    next >
C/C++ Source or Header  |  1988-08-13  |  2KB  |  52 lines

  1. /*=======================================================*/
  2. /*  TVINTBIT.C                                           */
  3. /*     functions to get and set second level interrupts  */
  4. /*                                                       */
  5. /*  (c) Copyright 1988 Ralf Brown  All Rights Reserved   */
  6. /*  May be freely copied for noncommercial use, so long  */
  7. /*  as this copyright notice remains intact, and any     */
  8. /*  changes are marked in the comment blocks preceding   */
  9. /*  functions.                                           */
  10. /*=======================================================*/
  11.  
  12. #include "tvapi.h"
  13.  
  14. /*======================================================*/
  15. /* TVgetbit--allocate a 2nd-level interrupt bit         */
  16. /*   Ralf Brown 4/2/88                                  */
  17. /*======================================================*/
  18.  
  19. WORD pascal TVgetbit(void far (*handler)(void))
  20. {
  21.    _ES = FP_SEG(handler) ;
  22.    _DI = FP_OFF(handler) ;
  23.    _AX = 0x1013 ;
  24.    geninterrupt(0x15) ;
  25.    return _BX ;     /* return the bitmask for allocated int, 0 if none avail */
  26. }
  27.  
  28. /*======================================================*/
  29. /* TVfreebit--deallocate a 2nd-level interrupt          */
  30. /*   Ralf Brown 4/2/88                                  */
  31. /*======================================================*/
  32.  
  33. void pascal TVfreebit(WORD bit)
  34. {
  35.    _BX = bit ;  /* bitmask from prior call to TVgetbit() */
  36.    _AX = 0x1014 ;
  37.    geninterrupt(0x15) ;
  38. }
  39.  
  40. /*======================================================*/
  41. /* TVsetbit--schedule a 2nd-level interrupt             */
  42. /*   Ralf Brown 4/2/88 renamed from SetBit              */
  43. /*======================================================*/
  44.  
  45. void pascal TVsetbit(WORD bit)            /* bit to set */
  46. {
  47.    _BX = bit ;
  48.    _AX = 0x1015 ;
  49.    geninterrupt(0x15) ;            /* issue the interrupt */
  50. }
  51.  
  52.